package com.cl.pattern.command;

/**
 * 关灯命令
 *
 * 具体命令
 */
public class LightOffCommand implements Command {
    private Receiver receiver;

    public LightOffCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    public void execute() {
        receiver.turnOFF();
    }

    /**
     * 撤销
     */
    public void undo() {
        receiver.turnON();
    }
}